package controller;

import com.opensymphony.xwork2.ActionSupport;
import com.sun.net.httpserver.Authenticator;
import entity.News;
import service.NewsService;

import java.util.ArrayList;
import java.util.List;

public class NewsAction extends ActionSupport {
    private NewsService newsService;
    private List<News> newsLists = new ArrayList<>();
    public String getAllNews(){
        newsLists =  newsService.getNewList();
        return "success";
    }

    public NewsService getNewsService() {
        return newsService;
    }

    public void setNewsService(NewsService newsService) {
        this.newsService = newsService;
    }

    public List<News> getNewsLists() {
        return newsLists;
    }

    public void setNewsLists(List<News> newsLists) {
        this.newsLists = newsLists;
    }
}
